export const getters = {
  counter: state => state.Num.counter,
  cartList: state => state.Cart.cartList, //获取购物车列表
  stateAll: state => state.Cart.stateAll,
  totalPrice: state => {
    let cartList = state.Cart.cartList // 购物车列表
    let total = cartList.reduce(
      (prevous, current) => prevous + (current.state ? current.price * current.num : 0),
      0
    );
    return total * 100;
  },
  user: state => state.User.user,
  token: state => state.User.token,
  address: state => state.Address.address,
};
